package com.ruoyi.common.utils.ehcache;

import com.ruoyi.common.constant.EqpStatus;

/**
 * @author huangziliang
 * @version 1.0
 * @date 2021/4/11 17:56
 */
public class EqpStatusCache {

    public static void setEqpStatus(String pid,EqpStatus status){
        EhcacheUtils.putObjectCache(EhcacheUtils.CACHE_NAME, pid, status);
    }

    public static EqpStatus getEqpStatus(String pid){
        Object cache = EhcacheUtils.getObjectCache(EhcacheUtils.CACHE_NAME, pid);
        if (cache == null){
            return EqpStatus.CLOSED;
        }else {
            return (EqpStatus) cache;
        }
    }

}
